<?php
include_once ('globalweixin.php');
if(isset($_GET[del])){
	mysql_query("DELETE FROM `fs` WHERE `id` = '$_GET[del]' LIMIT 1;");
	$msg = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
		<html xmlns="http://www.w3.org/1999/xhtml"><head>
				<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
				<link rel="stylesheet" href="css/common.css" type="text/css" />
				<meta http-equiv="refresh" content="2; URL=' . "weixin.php" . '" />
				<title>管理区域</title>
				</head>
				<body>
				<div id="man_zone">
				  <table width="30%" border="1" align="center"  cellpadding="3" cellspacing="0" class="table" style="margin-top:100px;">
				    <tr>
				      <th align="center" style="background:#cef">信息提示</th>
				    </tr>
				    <tr>
				      <td><p>' . "添加成功" . '<br />
				      2秒后返回指定页面！<br />
				      如果浏览器无法跳转，<a href="' . "weixin.php"  . '">请点击此处</a>。</p></td>
				    </tr>
				  </table>
				</div>
				</body>
				</html>';
		echo $msg;
		exit ();
}
if(isset($_POST[submit])){
    $sql="INSERT INTO `fs` (`id`, `keyword`, `content`, `time`) VALUES (NULL,  '$_POST[keyword]', '$_POST[content]',  '".mktime()."')";
	 $query=mysql_query($sql);
	//$db->get_show_msg("../weixin.php","添加成功");
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<meta name="Keywords" content="" />
<meta property="wb:webmaster" content="5adb8e96e1e2dc46" />
<meta property="qc:admins" content="56537054676221676546375" />
<meta name="Description" content="" />
<link href="templates/css/common_writer.css" rel="Stylesheet" type="text/css" />
<link href="templates/css/table_writer.css" rel="Stylesheet" type="text/css" />

</head>
<body>

<div id="head">
<div id="logo">
    <div class="logo_right">
    <div class="logo_left"><img src="templates/img/LogoMaker.png" alt="三峡大学失物招领平台"/></div>
	<p id="index_head_action_login">
	<span style="float: right;"><wb:login-button type="3,2" onlogin="login" onlogout="logout">登录按钮</wb:login-button>
</span>
	<span id="qqLoginBtn"></span>
		  <form action="admin/index.php" method="post">
           用户名：<input name="username" type="text"  class="top_tb" />
           密码：<input name="password" type="password"  class="top_tb" />
            <input type="submit" name="update" value="登 陆"  /></p>
			</form>
    </div>
</div>
<div id="head_nav">
    <ul>
       <li><a href="index.php">首 页</a> </li>
    </ul>
</div>

    </div>
    <div id="wrap">
        <div id="annoucement">

<div style="margin-left: 30px; margin-right: 30px; width: 740;">
    <marquee scrolldelay="100">
               <div>这里是三峡大学失物招领平台，完全属于三峡大学学生自己的平台，自主发布招领或者失物信息，让大家的东西别在失去主人</div></marquee>
</div>

        </div>
<?
  $mysql="select * from fs order by id desc";
  $ruster=mysql_query($mysql);
  
  while($row=mysql_fetch_array($ruster)){
?>
<table width=500 border="1" cellpadding="5" cellspacing="1" bgcolor="#add3ef" align="center">
  <tr bgcolor="#eff3ff">
  <td><strong>关键字：</strong><?=$row[keyword]?> <strong>时间：</strong><?=date("Y-m-d",$row[time])?> <a href='?del=<?php echo $row[id]?>'>删除</a></td>
  </tr>
  <tr bgColor="#ffffff">
  <td style="border-bottom-color:#3F3;">内容：<?
 echo htmtocode($row[content]);
   ?></td>
  </tr>
</table>
<?
  }
?>


  <form action="" method="post" name="myform" onsubmit="return CheckPost();">
  关键字：<input type="text" size="10" name="keyword" /><br>
  内容：<textarea name="content"  cols="60" rows="9"></textarea><br/>

  <input type="submit" name="submit" value="发布留言"/>
  
  </form>
  <div class="footer">
	      <hr style="color:#0F0;" />
	<p class="powered">    
		Powered by 三峡大学九章网络工作室 <script src="http://s4.cnzz.com/stat.php?id=4798280&web_id=4798280&show=pic" language="JavaScript"></script>
    您是本站的第<?echo $number[1]; ?>访客</p>
</div>
<script src="http://qzonestyle.gtimg.cn/qzone/app/qzlike/qzopensl.js#jsdate=20111201" charset="utf-8"></script>
<script src="http://tjs.sjs.sinajs.cn/open/api/js/wb.js?appkey=1883383586" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript"src="http://qzonestyle.gtimg.cn/qzone/openapi/qc_loader.js" data-appid="100362277"data-redirecturi="http://www.bbangnet.com/qc_callback.html" charset="utf-8"></script>
<script src="http://mat1.gtimg.com/app/openjs/openjs.js#autoboot=no&debug=no"></script>
<script type="text/javascript">
	QC.Login({
       btnId:"qqLoginBtn"	//插入按钮的节点id
});
if(QC.Login.check()){//如果已登录
	QC.Login.getMe(function(openId, accessToken){
		//alert(["当前登录用户的", "openId为："+openId, "accessToken为："+accessToken].join("\n"));
	});
	//这里可以调用自己的保存接口
	//...
}
//新浪登录开始
function login(o){
	//alert(o.screen_name)
}
function logout(){
	//alert('logout');
}
//新浪登录结束
	
</script>
</body>
</html>